package com.ar.engine.objLoader;

import java.util.ArrayList;

public class Face {

	private ArrayList<Vector3D> vertices;
	private ArrayList<Vector3D> normals;
	private ArrayList<Vector3D> uvws;
	
	
	public ArrayList<Vector3D> getVertices() {
		return vertices;
	}


	public void setVertices(ArrayList<Vector3D> vertices) {
		this.vertices = vertices;
	}


	public ArrayList<Vector3D> getNormals() {
		return normals;
	}


	public void setNormals(ArrayList<Vector3D> normals) {
		this.normals = normals;
	}


	public ArrayList<Vector3D> getUvws() {
		return uvws;
	}


	public void setUvws(ArrayList<Vector3D> uvws) {
		this.uvws = uvws;
	}
	
	public Vector3D getFaceNormal()
	{
		Vector3D vector1 = Vector3D.Subtract(this.vertices.get(0), this.vertices.get(1)).getNormalized();
		Vector3D vector2 = Vector3D.Subtract(this.vertices.get(0), this.vertices.get(2)).getNormalized();
		
		return Vector3D.Multiply(vector1, vector2);
	}

	public Face()
	{
		this.vertices = new ArrayList<Vector3D>();
		this.normals = new ArrayList<Vector3D>();
		this.uvws = new ArrayList<Vector3D>();
	}
	
}
